<template>
  <div >
    <van-nav-bar
        title="支付宝支付中..."
        left-text="返回"
        left-arrow
        @click-left="back()"
    />
  </div>
  <div>
    <p class="p1">订单名称：{{this.$store.state.orderapply.info}}</p>
<!--    <h2>金额：{{this.$store.state.orderapply.price}} 元</h2>-->
    <div class="cls01"><span >￥{{this.$store.state.orderapply.price}}</span></div>
    <div><van-button @click="sendPay()">确认支付</van-button></div>
  </div>
</template>

<script>
export default {
  name: "Pay",
  methods:{
    back(){
      history.back();
    },
    sendPay(){
      //发起创建支付请求
      var obj={
        money: this.$store.state.orderapply.price,
        oid: this.$store.state.orderapply.id,
        title: this.$store.state.orderapply.info,
        type: 1
      }
      this.axios.post("/api/pay/create.do",obj).then(res=>{
        if(res.data.code==200){
          //成功
          document.write("'"+res.data.data+"'");
        }else{

        }
      })
    }
  }
}
</script>

<style scoped>
.cls01{
  text-align: left;
  margin-top: 20px;
  color: red;
}
.p1{
  text-align: justify;
}
</style>